<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.01 frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Diff Report</title>
        <link title="Style" type="text/css" rel="stylesheet" href="${stylesheetPath}" />
        <script type="text/javascript">
            var lastSeenLeft = [ 0, 0 ];
            var lastSeenTop  = [ 0, 0 ];

            function checkScroll(div1, div2) {
                if (!div1 || !div2) {
                    return;
                }
                
                var control = null;
                if (div1.scrollLeft != lastSeenLeft[0]) {
                    control = div1;
                } else if (div1.scrollTop != lastSeenTop[0]) {
                    control = div1;                
                } else if (div2.scrollLeft != lastSeenLeft[1]) {
                    control = div2;
                } else if (div2.scrollTop != lastSeenTop[1]) {
                    control = div2;
                }
                
                if (control == null) {
                    return;
                } else {
                    div1.scrollLeft = div2.scrollLeft = control.scrollLeft;
                    div1.scrollTop = div2.scrollTop = control.scrollTop;
                }

                lastSeenLeft[0] = div1.scrollLeft;
                lastSeenLeft[1] = div2.scrollLeft;
                lastSeenTop[0] = div1.scrollTop;
                lastSeenTop[1] = div2.scrollTop;
            }

            window.setInterval("checkScroll(document.getElementById('leftFile'), document.getElementById('rightFile'))", 1);
        </script>
    </head>
    <body>
        <div class="diff">
            <h5>Diff Report for - ${filePath}</h5>
                 
            <div class="sideBySideView">
                <div id="leftFile" style="float:left; width: 50%; height: 90%; overflow-x: scroll; overflow-y: scroll;">
                    <pre><table cellspacing="0" cellpadding="0" style="border-collapse: collapse;" width="100%">
                        <thead>
                            <tr>
                                <td width="4%"  class="heading">Line</td>
                                <td width="1%"  class="heading">&nbsp;</td>
                                <td width="95%" class="heading">Code</td>
                            </tr>
                        </thead>
                        <tbody id="lines">
                            <#list leftFile as line>
                                ${line}
                            </#list>
                        </tbody>
                    </table></pre>
                </div>

                <div id="rightFile" style="float:right; width: 50%; height: 90%; overflow-x: scroll; overflow-y: scroll;">
                    <pre><table cellspacing="0" cellpadding="0" style="border-collapse: collapse;" width="100%">
                        <thead>
                            <tr>
                                <td width="4%"  class="heading">Line</td>
                                <td width="1%"  class="heading">&nbsp;</td>
                                <td width="95%" class="heading">Code</td>
                            </tr>
                        </thead>
                        <tbody id="lines">
                            <#list rightFile as line>
                                ${line}
                            </#list>
                        </tbody>
                    </table></pre>
                </div>
        
                <div class="footer" style="clean: both">
                    Report generated by <a href="${svnDiffDocSiteUrl}" target="_top">SvnDiffDoc</a> ${svnDiffDocVersion} on ${reportGenerationDate}.
                </div>
            </div>
        </div>
    </body>
</html>
